package app.netant.book.xinguli;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class XinguliRoot extends BaseRoot {
	
	public XinguliRoot(){
		this.homeUrl = "http://www.xinguli.com/shuku/default_nv_0_2.html";
		this.pageUrl = "http://www.xinguli.com/shuku/default_nv_0_";
		this.tableKey = "xinguli";
	}

	@Override
	public String buildUrl(int pageIdx) {
		return this.pageUrl + pageIdx+".html";
	}

	@Override
	public BasePage buildPage(String url) {
		return new XinguliPage(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new XinguliDetail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new XinguliEntity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		XinguliRoot root = new XinguliRoot();
		//root.analyse(5);
		root.excepCycle();
	}


	
}
